package com.lovegu.generic;

import com.sun.org.apache.xpath.internal.operations.String;

import java.util.ArrayList;
import java.util.Collection;

/**
 * @author 老顾
 * @title: Dao
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/9/24 15:35
 */
public class DaoTest {
    public <E> E get(int id,E e){
        E result = null;
        return result;
    }
    public static <T> void formArrayToCollection(T[] a, Collection<T> c){
        for (T o : a) {
            c.add(o);
        }
    }

    public static void main(String[] args) {
        Object[] ao = new Object[100];
        Collection<Object> co = new ArrayList<>();
        formArrayToCollection(ao,co);
        String[] sa = new String[20];
        Collection<String> cs = new ArrayList<>();
        formArrayToCollection(sa,cs);
        Collection<Double> cd = new ArrayList<>();
        formArrayToCollection(sa,co);
    }
}
